# PowerShell 7.5 兼容版高亮与补全配置

# 启用语法高亮
Set-PSReadLineOption -Colors @{
    Command            = "Green"    # 命令高亮
    Parameter          = "Cyan"     # 参数高亮
    Variable           = "Blue"     # 变量高亮
    String             = "Yellow"   # 字符串高亮
    InlinePrediction   = "DarkGray" # 建议文本颜色
}

# 启用命令建议和补全
Set-PSReadLineOption -PredictionSource HistoryAndPlugin  # 基于历史和插件的建议
Set-PSReadLineOption -PredictionViewStyle ListView        # 列表形式显示建议

# 快捷键配置
Set-PSReadLineKeyHandler -Key Tab -Function Complete       # Tab键补全
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward  # 向上搜索历史
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward  # 向下搜索历史
